    <div class="wrap test" style="margin-bottom: 100px;">

      <?php $money = 0 ?>
      您选购了：
      <ul>
        <?php foreach ($explanations as $explanation): ?>
        <li>
          <?php echo $explanation->getTitle() ?> -
          价值：<?php echo $explanation->getCost(); $money += $explanation->getCost(); ?>元
        </li>
        <?php endforeach ?>
      </ul>

      <p>您需要支付 <?php echo $money ?>元</p>
      <p>您的帐户中有 <?php echo $sf_user->getPoint() ?>元</p>
      <?php if ($money > $sf_user->getPoint()): ?>
      <p>余额不足，<a href="<?php echo url_for('@addfund') ?>">支付宝充值</a></p>
      <p><a href="<?php echo url_for('@test?id='.$test->getId()) ?>">返回报告</a></p>
      <?php else: ?>
      <p>
      确定要支付吗？
      <form method="post" action="<?php echo url_for('@payment_pay') ?>">
        <?php foreach ($explanations as $explanation): ?>
        <input type="hidden" name="explanation_ids[]" value="<?php echo $explanation->getId() ?>" />
        <?php endforeach ?>
        <input type="hidden" name="test_id" value="<?php echo $test->getId() ?>" />
        <input type="submit" value="购买" />
      </form>
      </p>
      <?php endif ?>

    </div>
